<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="include/base.jsp" %>
<!DOCTYPE HTML>
<html lang="zh-CN">
<head>
	<meta charset="UTF-8">
	<title>项目管理系统</title>
	<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />
	<link rel="stylesheet" type="text/css" href="css/loong.css" />
	<link rel="stylesheet" type="text/css" href="css/select2.css" />
	<script type="text/javascript" src="js/jquery.min.js"></script>
    <script type="text/javascript" src="js/select2.min.js"></script>
    
</head>
<body class="body">
	
	<%@ include file="include/top.jsp" %>
	
	
	<div class="container" >
	  <div class="row row-inner">
		<div class="span9">
			<form class="form-horizontal" action="project.jspx" method="post">
		        <fieldset>
		          <legend>开始一个新项目</legend>
		          <div class="control-group">
		            <label class="control-label" for="input01" >项目名称</label>
		            <div class="controls">
		              <input type="text" class="span5" id="input01" x-webkit-speech="undefined"name="projectname">
		            </div>
		          </div>
		          <div class="control-group">
		            <label class="control-label" for="input01" >项目描述</label>
		            <div class="controls">
		              <textarea class="span5" rows="4" name="desc"></textarea>
		            </div>
		          </div>
		          <div class="control-group">
		            <label class="control-label" for="multiSelect">负责人</label>
		            <div class="controls">
		               <select id="e1" name="captain" >
		                <option >---------------</option>
		                <c:forEach var="listItem" items="${requestScope.list}" >
		                	<option value="${listItem.username}">${listItem.username }</option>
		                	 
		                </c:forEach>
		              </select>
		            </div>
		          </div>
		         <div class="control-group">
		            <label class="control-label" for="input01">项目成员</label>
		            <input type="hidden" id="team" name="team">
		            <div class="controls">
		              <select multiple="multiple" name="e9" id="e9" style="width:300px" class="populate select2-offscreen" tabindex="1" >        
					   <optgroup label="---------------">
						   <c:forEach var="listItem" items="${requestScope.list}" >
		                	<option >${listItem.username }</option>
		                </c:forEach>
					   </optgroup>
					  </select>
		            </div>
		          </div>
		          
		          <div class="form-actions">
		            <button type="button" id="btn" class="btn btn-primary">保存</button>
		            <button class="btn" onclick="location.back()">返回</button>
		          </div>
		        </fieldset>
		      </form>          
          	
		</div>
		<div class="span3">
			
		</div>
	  </div>
	  <%@ include file="include/foot.jsp" %>
	</div>
	<script type="text/javascript">
        $(document).ready(function() {
         	$("#e1").select2();
			$("#e9").select2({
			    placeholder: "请选择成员"
			});
         	$("#btn").click(function(){
         		 $("#team").val($("#e9").select2("val").toString());
         		$("form").submit();
         	});
         });
        
    </script>
</body>
</html>